!--------------------------------------------------!
!   initialize                                     !
!--------------------------------------------------!
        SUBROUTINE INITIA()
        USE BASIC_MOD
        IMPLICIT NONE
        INTEGER:: I,J,COUNT,N
	    REAL*8:: GET_CPI,GET_HI
        INTEGER,POINTER:: FLAG(:)
	
!-----SET SIZE OF DYNAMIC ARRAY
      ALLOCATE (UU(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (VV(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (PP(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (DD(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (TT(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (TT0(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (CC(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (MA(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (CP(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (HH(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (EE(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (GA(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (WAV(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (RGAS(1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (CS(4,1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (CS0(4,1-D0:XCELLS+D0,1-D0:YCELLS+D0))
      ALLOCATE (FLUXE(0:XCELLS+1,0:YCELLS+1,4))
      ALLOCATE (FLUXW(0:XCELLS+1,0:YCELLS+1,4))
      ALLOCATE (FLUXS(0:XCELLS+1,0:YCELLS+1,4))
      ALLOCATE (FLUXN(0:XCELLS+1,0:YCELLS+1,4))
      ALLOCATE (RHS(4,XCELLS,YCELLS))
!-----SET INITIAL VALUES OF EACH CELL
      DO J=1,YCELLS
        DO I=1,XCELLS
            DD(I,J)=1.2D0
	        IF(X(I,J).GE.50D0) THEN
                PP(I,J)=1d6
            ELSE
                PP(I,J)=1d5
            END IF
            ma(i,j)=0.d0
            GA(I,J)=1.4D0
            WAV(I,J)=29.D0
            TT0(I,J)=TT(I,J)
	        RGAS(I,J)=R00*1000/WAV(I,J)
            TT(I,J)=PP(I,J)/(RGAS(I,J)*DD(I,J))
	        CP(I,J)=GA(I,J)*RGAS(I,J)/(GA(I,J)-1.D0)
            HH(I,J)=CP(I,J)*TT(I,J)
            EE(I,J)=CP(I,J)*TT(I,J)/GA(I,J)
            CC(I,J)=SQRT(GA(I,J)*PP(I,J)/DD(I,J))
            UU(I,J)=MA(I,J)*CC(I,J)!*COS(-25.D0*ATAN(1.D0)*4/180.D0)
	        VV(I,J)=0.d0
            CS(1,I,J)=DD(I,J)
            CS(2,I,J)=DD(I,J)*UU(I,J)
            CS(3,I,J)=DD(I,J)*VV(I,J)
            CS(4,I,J)=DD(I,J)*EE(I,J)+.5D0*(UU(I,J)**2+VV(I,J)**2)*DD(I,J)	

        END DO 
      END DO 
      RETURN  
    END SUBROUTINE INITIA
    

    
